///
/// This method will add three records rows in the table control
///
public Boolean IsLoadDataCalled = false;
public override void LoadData()
{
// Call base.LoadData()
base.LoadData();
if (!this.Page.IsPostBack && !IsLoadDataCalled)
{
IsLoadDataCalled = true;
ArrayList list;
if ((DataSource == null))
{
list = new ArrayList();
}
else
{
list = new ArrayList(this.DataSource);
}
int i;
for (i = 0; i < 3; i++)
{
// To insert rows at the end of the table control
list.Add(new ${${Table Name}RecordClassName}());
// To insert rows at the top of the table control
// list.Insert(i, new ${${Table Name}RecordClassName}());
}
this.DataSource = (${${Table Name}RecordClassName}[])(list.ToArray(typeof(${${Table Name}RecordClassName})));
}
}
|